tests: Add a test case for unwritable repos
authorMatthew Barnes <mbarnes@redhat.com>
Wed, 4 Feb 2015 02:44:38 +0000 (21:44 -0500)
committerColin Walters <walters@verbum.org>
Wed, 25 Mar 2015 21:24:06 +0000 (17:24 -0400)
tests/basic-test.sh

index da62c0d05cf2f455b3a4d4ac1843de55c7e9bf50..2c0455e5e8216226e5569273375935b7b1cc4355 100755 (executable)
@@ -368,3 +368,14 @@ mkdir -p test2-checkout
 cd test2-checkout
 touch should-not-be-fsynced
 $OSTREE commit -b test2 -s "Unfsynced commit" --fsync=false
+
+cd ${test_tmpdir}
+rm -f expected-fail error-message
+$OSTREE init --mode=archive-z2 --repo=repo-noperm
+chmod -w repo-noperm
+$OSTREE --repo=repo-noperm pull-local repo 2> error-message || touch expected-fail
+assert_has_file expected-fail
+assert_file_has_content error-message "Permission denied"
+chmod +w repo-noperm
+echo "ok unwritable repo was caught"
+